<?php

class Scaffold_DefaultDb_Vehicle extends Model3_Scaffold_Model
{

    public function __construct()
    {
        $this->_class = 'DefaultDb_Entities_Vehicle';

        $this->_columns['name'] = array(
            'label' => 'Nombre',
            'required' => true,
        );

        $this->_columns['type'] = array(
            'label' => 'Tipo',
            'enum' => array(
                DefaultDb_Entities_Vehicle::TYPE_UNKNOWN => 'Desconocido',
                DefaultDb_Entities_Vehicle::TYPE_CAJA_SECA => 'Caja seca',
            )
        );

        $this->_columns['volume'] = array(
            'label' => 'Volumen (ft³)',
            'labelColumn' => 'Volumen',
            'postfix' => array(
                'symbol' => 'ft³',
                'description' => 'pies cúbicos',
            ),
            'required' => true,
        );

        $this->_columns['economicNumber'] = array(
            'label' => 'Número económico',
            'required' => true,
        );

        $this->_columns['capacity'] = array(
            'label' => 'Capacidad de carga (Kg)',
            'labelColumn' => 'Capacidad',
            'postfix' => array(
                'symbol' => 'kg',
                'description' => 'Kilogramos',
            ),
            'required' => true,
        );

        $this->_columns['tradeMark'] = array(
            'label' => 'Marca',
            'required' => true,
        );

        $this->_columns['plate'] = array(
            'label' => 'Placas',
            'required' => true,
        );

        $this->_columns['color'] = array(
            'label' => 'Color',
            'required' => true,
        );

        $this->_columns['gps'] = array(
            'label' => 'G.P.S.',
            'required' => true,
        );

        $this->_columns['model'] = array(
            'label' => 'Modelo',
            'required' => true,
        );

        $this->_columns['width'] = array(
            'label' => 'Ancho',
            'labelColumn' => 'Ancho',
            'postfix' => array(
                'symbol' => 'm',
                'description' => 'Metros',
            ),
            'required' => true,
        );

        $this->_columns['height'] = array(
            'label' => 'Alto',
            'labelColumn' => 'Altura',
            'postfix' => array(
                'symbol' => 'm',
                'description' => 'Metros',
            ),
            'required' => true,
        );

        $this->_columns['deep'] = array(
            'label' => 'Profundidad',
            'labelColumn' => 'Prof.',
            'class' => 'col-lg-2',
            'postfix' => array(
                'symbol' => 'm',
                'description' => 'Metros',
            ),
            'required' => true,
        );

        $this->_externalActions['Asignar'] = array(
            'module' => 'Admin',
            'controller' => 'Vehicles',
            'action' => 'assign',
        );

        $this->_attrsRow = array('status' => true);

        $this->_sideServer = array(
            'name' => array
                (
                'filter' => FILTER_VALIDATE_REGEXP,
                'options' => array('regexp' => '/.+/'),
                'message' => 'Nombre es requerido',
            ),
            'volume' => array
                (
                array
                    (
                    'filter' => FILTER_VALIDATE_REGEXP,
                    'options' => array('regexp' => '/.+/'),
                    'message' => 'Volumen es requerido',
                ),
                array
                    (
                    'filter' => FILTER_VALIDATE_FLOAT,
                    'flags' => FILTER_FLAG_ALLOW_THOUSAND,
                    'message' => 'Volumen debe ser numerico',
                )
            ),
            'economicNumber' => array
                (
                'filter' => FILTER_VALIDATE_REGEXP,
                'options' => array('regexp' => '/.+/'),
            ),
            'capacity' => array
                (
                'filter' => FILTER_VALIDATE_FLOAT,
                'flags' => FILTER_FLAG_ALLOW_THOUSAND,
            ),
            'tradeMark' => array
                (
                'filter' => FILTER_VALIDATE_REGEXP,
                'options' => array('regexp' => '/.+/'),
            ),
            'plate' => array
                (
                'filter' => FILTER_VALIDATE_REGEXP,
                'options' => array('regexp' => '/.+/'),
            ),
            'color' => array
                (
                'filter' => FILTER_VALIDATE_REGEXP,
                'options' => array('regexp' => '/.+/'),
            ),
            'gps' => array
                (
                'filter' => FILTER_VALIDATE_REGEXP,
                'options' => array('regexp' => '/.+/'),
            ),
            'model' => array
                (
                'filter' => FILTER_VALIDATE_REGEXP,
                'options' => array('regexp' => '/.+/'),
            ),
            'width' => array
                (
                'filter' => FILTER_VALIDATE_FLOAT,
                'flags' => FILTER_FLAG_ALLOW_THOUSAND,
            ),
            'height' => array
                (
                'filter' => FILTER_VALIDATE_FLOAT,
                'flags' => FILTER_FLAG_ALLOW_THOUSAND,
            ),
            'deep' => array
                (
                'filter' => FILTER_VALIDATE_FLOAT,
                'flags' => FILTER_FLAG_ALLOW_THOUSAND,
            ),
        );
        parent::__construct();
    }

}
